#include<bits/stdc++.h>

using namespace std;

int main() {
	int x, y, z;
	for (x = 123; 3 * x <= 987; x++) {
		y = 2 * x;
		z = 3 * x;
		int b[10] = {0};
		b[x / 100]++;
		b[x % 100 / 10]++;
		b[x % 10]++;
		b[y / 100]++;
		b[y % 100 / 10]++;
		b[y % 10]++;
		b[z / 100]++;
		b[z % 100 / 10]++;
		b[z % 10]++;
		int flag = 1;
		for (int i = 1; i <= 9; i++) {
			if (b[i] != 1) {
				flag = 0;
				break;
			}
		}
		if (flag == 1)
			cout << x << " " << y << " " << z << endl;

	}
    return 0;
} 
